/**
 * Ingenius-Group S.A.S
 *
 * Project: SAU
 * File: UsersServiceAsync.java
 * Date: 28/02/2011
 */

package com.ingenius.sau.client.service;

import java.util.List;

import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
import com.extjs.gxt.ui.client.data.PagingLoadResult;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.ingenius.sau.shared.model.users.Group;
import com.ingenius.sau.shared.model.users.Role;
import com.ingenius.sau.shared.model.users.User;
import com.ingenius.sau.shared.util.filter.Filter;

/**
 * Class <strong>UsersServiceAsync</strong>
 * 
 * @author Jesus David
 * @version 0.1
 */
public interface UsersServiceAsync {

	void deleteGroup(String id, AsyncCallback<Boolean> callback);

	void deleteRole(String id, AsyncCallback<Boolean> callback);

	void deleteUser(String id, AsyncCallback<Boolean> callback);

	void findGroups(List<Filter> filters, BasePagingLoadConfig config,
			AsyncCallback<PagingLoadResult<Group>> callback);

	void findRoles(List<Filter> filters, BasePagingLoadConfig config,
			AsyncCallback<PagingLoadResult<Role>> callback);

	void findUsers(List<Filter> filters, BasePagingLoadConfig config,
			AsyncCallback<PagingLoadResult<User>> callback);

	void getGroup(String id, AsyncCallback<Group> callback);

	void getRole(String id, AsyncCallback<Role> callback);

	void getUser(String id, AsyncCallback<User> callback);

	void saveOrUpdateGroup(Group group, AsyncCallback<Boolean> callback);

	void saveOrUpdateRole(Role role, AsyncCallback<Boolean> callback);

	void saveOrUpdateUser(User user, AsyncCallback<Boolean> callback);

	void loadAllRoles(AsyncCallback<List<Role>> callback);

	void hasPermission(String module, String action,
			AsyncCallback<Boolean> callback);

}
